package game.ghostleg;

import android.app.Activity;
import android.graphics.Point;
import android.os.Bundle;
import android.view.Display;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class GhostLegAPI10Activity extends Activity {
	
	protected GhostLegView mView;
	protected String IPAddress;
	protected Thread td;
	protected Button nextButton;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ghost_layout);
        int pPlayerNum = 2;

        Point size=new Point();
        Display display = getWindowManager().getDefaultDisplay();
        // display.getSize(size);
        int width = display.getHeight();
        int height = display.getWidth();
        
        boolean isHost = false;
        PlayerInfo pPlayerInfo = new PlayerInfo("Ken",1);
        
        /*
        boolean isHost = true;
        PlayerInfo pPlayerInfo = new PlayerInfo("123",3);
        */
        mView = (GhostLegView) findViewById(R.id.ghostleg);
        mView.setScreenSize(width,height);
        mView.startSetup(isHost, pPlayerInfo, pPlayerNum);
        System.err.println("FUCK");
        mView.hostID = 3;
        
        mView.setConfirmButton((Button)findViewById(R.id.confirmButton));
        System.err.println("DAMN");
        mView.setServerSocket();
        nextButton = (Button)findViewById(R.id.returnButton);
        nextButton.setOnClickListener(new OnClickListener() {
        	@Override
        	public void onClick(View v) { finish(); }
        });
        nextButton.setVisibility(View.INVISIBLE);
        mView.setNextButton(nextButton);
        mView.start();
        td = new Thread(mView);
        td.start();
    }

    
}